/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2014年11月13日         Root.Lu
 */

package com.tianci.appstore.framework.db;

import android.content.Context;

import com.skyworth.framework.skysdk.android.SkyDBUtil;

public abstract class DBTable {
    protected SkyDBUtil dbUtil = null;
    protected Context mContext = null;

    public final void setContext(Context context) {
        mContext = context;
    }

    public final void setSkyDBUtil(SkyDBUtil dbUtil) {
        this.dbUtil = dbUtil;
    }

    public abstract void init();

    public abstract String getTableName();

    public abstract String[][] getColumnsAndTypes();

    protected final void waitDBUtilReady() {
        while (dbUtil == null)
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    }
}
